Skip to content

fix(vue): F89 JSDoc fix, F90 dual-script merge, F92 lang plumbing (#1936)#2050

Merged
magyargergo merged 9 commits into
abhigyanpatwari:mainfrom
prajapatisparsh:fix/vue-sfc-coverage
Jun 7, 2026
Merged

fix(vue): F89 JSDoc fix, F90 dual-script merge, F92 lang plumbing (#1936)#2050
magyargergo merged 9 commits into
abhigyanpatwari:mainfrom
prajapatisparsh:fix/vue-sfc-coverage

Conversation

@prajapatisparsh

Copy link
Copy Markdown
Contributor

F89: JSDoc corrected (0-based → 1-based, behavior unchanged)
F90: merge <script> + <script setup> blocks (was: only setup)
F92: plumb lang through to select JS vs TS captures

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

@prajapatisparsh is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
10605 10589 0 16 580s

✅ All 10589 tests passed

16 test(s) skipped — expand for details
  • COBOL pipeline benchmark > scales with file count
  • C++ ADL emit benchmark > emit phase scales sub-quadratically with co-scaled files and sites
  • C++ pipeline benchmark > scales with file count
  • C# pipeline benchmark > scales with file count — namespaces spread across the solution
  • C# pipeline benchmark > scales with file count — all types in one (global) namespace bucket
  • C# pipeline benchmark > scales with file count — all types in one (named) namespace bucket
  • Go pipeline benchmark > scales with file count (workers enabled)
  • Go pipeline benchmark — worker pool (issue Worker idle timeout kills long Go scope extraction and surfaces as Napi::Error during analyze #1848) > does not quarantine the large generated Go file on sub-batch idle timeout
  • Go structural interface detection benchmark > scales linearly with interface × struct count
  • Go structural interface detection split-phase benchmark > separates index-build and detection time
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • Ruby pipeline benchmark > scales with file count (workers enabled)
  • Rust pipeline benchmark > scales with file count (workers enabled)
  • Vue pipeline benchmark > scales with component count
  • run.cjs direct-exec entrypoint (fix(cli): steer docs, skills, and hooks through a CLI-neutral project-local runner (#1939) #1945) > resolves a .cmd shim via the Windows shell branch, passing args and exit code
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 74.3% 34471/46389 N/A% 🟢 ██████████████░░░░░░
Branches 62.28% 21337/34257 N/A% 🟢 ████████████░░░░░░░░
Functions 79.6% 3692/4638 N/A% 🟢 ███████████████░░░░░
Lines 78.16% 31216/39938 N/A% 🟢 ███████████████░░░░░

📋 View full run · Generated by CI

@magyargergo magyargergo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #2050 tri-review — Vue SFC dual-script merge & JS/TS routing

Methods (3): GitNexus reviewer swarm + Compound-Engineering personas (both Claude) and Codex (the one independent engine). Engine breakdown: 8 Claude lanes — correctness, adversarial, maintainability, testing, risk, test/CI, plus a Vue-SFC expert and a TypeScript/tree-sitter expert added at your request (risk & test/CI ended mid-investigation; their domains were covered by the other lanes) — and Codex live. Codex ran as a foreground, not-prompted-from-Claude-output call and independently confirmed all three headline findings. Note on independence: the two Claude methods share priors, so Claude-only agreement is "consistent across personas," not independent confirmation; the strong signal here is Codex + a Claude lane + a reproduction.

What's solid (validated — credit where due): the extractVueScript merge logic and the new lang field work as intended on the sequential (<15-file) path, and the extractor unit tests pass. Two suspected problems were refuted and excluded (validation is a feature): (a) feeding a TS-grammar cached tree into emitJsScopeCaptures does not corrupt captures — it is guarded by jsCachedTreeMatchesGrammar and re-parsed; (b) the F89 lineOffset doc change is accuratecountNewlines(precedingText)+1 is genuinely 1-based and the consumer math (+ node 0-based row) is correct, no off-by-one introduced.

Headline (P1 — reproduced)

For a .vue with an explicit <script lang="js"> block followed by a <script setup lang="ts"> block, extractVueScript merges both and returns lang = blocks[0].lang = 'js', so emitVueScopeCaptures routes the combined JS+TS text to the JavaScript grammar. Reproduced with the repo's pinned grammars on that merged content: tree-sitter-javascript → 1 ERROR + 1 missing node, the interface fails to parse; tree-sitter-typescript → 0 errors, clean. This is a regression — before this PR only the <script setup> (TS) block was extracted and parsed as TS. (Trigger needs an explicit lang="js"; an absent lang routes to TS and is safe.) Codex and the adversarial lane independently confirmed/reproduced it.

Inline findings

  • [P1] captures.ts:74 / vue-sfc-extractor.ts:269 — mixed-lang merged content routed to one grammar via blocks[0].lang (the headline above).
  • [P2] captures.ts:62-63setupLang is read but never set by any caller (the bridge passes only { sourceKind }; the LanguageProvider contract type omits it; repo-wide grep finds zero setters). So in worker mode (≥15 files — the large-repo path this branch targets) every .vue routes to emitTsScopeCaptures, silently losing the JS-only passes (CJS require() decomposition, JSDoc type-bindings). Not a crash and not a regression vs base — but F92's routing fix doesn't reach the worker path, and the comment "the parse worker passes langs via sourceMeta.setupLang" is actively misleading.
  • [P2] vue-sfc-extractor.ts:266lineOffset = blocks[0].lineOffset uses source order while combinedContent is built from ordered (non-setup first); divergent when <script setup> precedes <script>, and the single-newline join collapses the inter-block gap so the second block's lines are off regardless. Affects user-visible line numbers (jump-to-line / call-site annotations), not graph topology.
  • [P2/P3] new fixturesvue-dual-script/App.vue and vue-js-lang/App.vue are referenced by no test and lack the src/ mini-repo layout the integration suite uses; their natural home is test/integration/resolvers/vue-scope.test.ts (which currently runs only vue-composition-api / vue-options-api / vue-cross-file).

Lower-priority / notes

  • Absent lang="" routes to TS even though Vue's default script lang is JS — harmless (TS is a superset) but plain <script> JS also misses the JS-only passes; consider routing '' | 'js' | 'jsx' → JS.
  • lang="jsx"/"tsx" (newly advertised in the doc) route to the non-JSX TS grammar (grammar is chosen by the .vue extension) → JSX would ERROR-node. Pre-existing; consider trimming the doc claim.
  • Stale doc: languages/vue/index.ts:40-42 still says "only <script setup> is processed… the non-setup block is skipped" — contradicts the new merge (that file is not in this diff).
  • Comment at vue-sfc-extractor.ts:267-268 ("the template compiler will catch it") — GitNexus never runs the Vue template compiler; mismatched-lang blocks are silently mis-parsed here.

Test gaps

No test exercises the worker (pre-extracted-script) routing, the full-pipeline JS-lang or dual-script paths (the new fixtures would, if wired), <script setup>-before-<script> ordering, or symbol line numbers for merged blocks. The merge test asserts presence (toContain) but not order.

CI: all green except Vercel (deploy authorization, not a code issue) — typecheck/lint/tests/coverage pass. Coverage of this review: the full 5-file diff was read and the headline reproduced; the PR head moved mid-review (a main merge bringing in unrelated MCP work, #2049) but no Vue file changed, so these findings apply to the current head.

Automated multi-tool digest (GitNexus swarm + Compound-Engineering personas + Codex). Verify before acting; inline anchors mark the most load-bearing lines.

Comment thread gitnexus/src/core/ingestion/languages/vue/captures.ts Outdated
Comment thread gitnexus/src/core/ingestion/languages/vue/captures.ts Outdated
Comment thread gitnexus/src/core/ingestion/vue-sfc-extractor.ts Outdated
@@ -0,0 +1,7 @@
<template>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2/P3 — testing, code-read] This fixture (and vue-dual-script/App.vue) is referenced by no test — a repo-wide grep finds zero consumers. The integration suite test/integration/resolvers/vue-scope.test.ts loads fixtures by explicit path and runs only vue-composition-api / vue-options-api / vue-cross-file; these new dirs also lack the src/ mini-repo layout those use. So the JS-lang routing and the dual-script merge are covered only by the pure-extractVueScript unit tests — never end-to-end, and never on the worker path (which would expose the dead setupLang).

Actionable path: add describe blocks to vue-scope.test.ts that run runPipelineFromRepo against these fixtures and assert symbols from both blocks / JS-style captures appear — or remove the fixtures. [code-read]

@prajapatisparsh

Copy link
Copy Markdown
Contributor Author

on it

@magyargergo

Copy link
Copy Markdown
Collaborator

There are two failures

  
  ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
  
   FAIL   default  test/integration/resolvers/vue-scope.test.ts > F90 — dual-script (<script> + <script setup>) > includes symbols from both the non-setup and setup blocks
  AssertionError: expected [] to include 'ref'
   ❯ test/integration/resolvers/vue-scope.test.ts:490:19
      488|   it('includes symbols from both the non-setup and setup blocks', () =…
      489|     const funcs = getNodesByLabel(result, 'Function');
      490|     expect(funcs).toContain('ref'); // from <script setup> import
         |                   ^
      491|   });
      492| });
  
  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
  
   FAIL   default  test/integration/resolvers/vue-scope.test.ts > F92 — JS-lang script block > parses <script lang="js"> content
  AssertionError: expected [] to include 'createApp'
   ❯ test/integration/resolvers/vue-scope.test.ts:507:19
      505|   it('parses <script lang="js"> content', () => {
      506|     const funcs = getNodesByLabel(result, 'Function');
      507|     expect(funcs).toContain('createApp');
         |                   ^
      508|   });
      509| });
  
  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
  
  
   Test Files  1 failed | 429 passed | 8 skipped (438)
        Tests  2 failed | 10230 passed | 16 skipped (10248)
     Start at  08:54:17

@magyargergo magyargergo linked an issue Jun 6, 2026 that may be closed by this pull request
4 tasks
@magyargergo magyargergo merged commit baca749 into abhigyanpatwari:main Jun 7, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue: parsing-layer coverage gaps (4 findings)

2 participants